package vn.vntracking.truck;

public class SMS {

	private static DB db = new DB();
	private String content = null;
	
	public SMS(String content) {
		this.content = content;
	}
	
	public String getAddress(){

		String[] tokens = content.split(" ");

		if(tokens.length == 4){
			String temp = db.numPlateToDeviceID(tokens[0], tokens[3]);
			System.out.println(temp);
			return db.checkDevice(tokens[0], tokens[1], tokens[2], temp);
		}
		return null;
	}

	public static void main(String[] args){

		String temp = "tasa_hpg quanlyxe_dd 1 16N-1154";
		SMS sms = new SMS(temp);
		
		String content = sms.getAddress();
		System.out.println(content);

	}
}
